<?php
class ExhibitorsModel extends BaseModel implements Model {
    function __construct() {
        parent::__construct("exhibition_company_products", "");
        $this->addField("company_id", Model::TYPE_INT, Model::MOD_FOREIGN, array(
            remoteTableModel => "companies",
        ));
        $this->addField("companyname", Model::TYPE_TEXT, Model::MOD_REMOTE, array(
            remoteTableModel => "companies",
        ));
        $this->addField("hphungarian", Model::TYPE_TEXT, Model::MOD_REMOTE, array(
            remoteTableModel => "companies",
        ));
        $this->addField("exhibition_id", Model::TYPE_INT, Model::MOD_FOREIGN, array(
            remoteTableModel => "exhibition",
        ));
    }

    public function getExhibitors() {
        $today = date("Y-m-d");
        $result = $this->loadAll("startdate <= '$today' AND enddate >= '$today'", false, true);
        return $result;
    }

    public function renderAlias($record) {
        $result = $record;
        return $result;
    }

    public function isAuthorized($operation, $subject = "") {
        return true;
    }

    public function modifyDatabaseInput($data) {
        return $data;
    }
}

?>
